package com.ryskoo.catering.producttemplateattr.repository;

import com.ryskoo.catering.constant.HCLCacheConstant;
import com.ryskoo.catering.producttemplateattr.domain.ProductTemplateAttrPO;
import com.ryskoo.framework.core.repository.BasicRedisImpl;
import com.ryskoo.framework.core.utils.RedisUtil;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Primary;
import org.springframework.stereotype.Repository;

import javax.annotation.PostConstruct;

@Primary
@Repository
public class ProductTemplateAttrRedisImpl extends BasicRedisImpl<ProductTemplateAttrPO> implements IProductTemplateAttrRepository{

    @Autowired
    private RedisUtil redisClient;
    @Autowired
    private IProductTemplateAttrRepository productTemplateAttrRepository;
    @PostConstruct
    public void init(){
        this.setDao(productTemplateAttrRepository);
        this.setRedisClient(redisClient);
    }

    public ProductTemplateAttrRedisImpl() {
        super(HCLCacheConstant.HCL_PRODUCTTAG_KEY);
    }
}
